/*===== a2tvtr.h - file for work with models files ========*/
#define A2TVTR_H
/*===== Primary data types ================================*/
#include "a2tvdef.h"          /* TINT, LDSC, WCB, PCB, DOC */

/*====== Common structures and constants description ======*/
#ifndef A2TRDEF_H
#include "a2trdef.h"
#endif

#ifdef __cplusplus
extern "C" {
#endif
/*------------- a2tvpw - write model to tree --------------*/
a2tvpw(int *err,void *ptree, PCB *pcb, char *pform);
       /* err= 0, O'K                                      */
       /* err=-2, were errors                              */
/*------------ a2tvpr - read model from tree --------------*/
PCB *a2tvpr(int *err, void *ptree, char *pform, char *pname);
       /* err= 0, O'K                                      */
       /*     -1 form not found                            */
       /*     -2 errors of reading                         */
       /*     -3 not enough memory                         */
       /*     -4 part description contains errors          */
/*a2tvpgd - get model from db schema                       */
/*                    (with use of virtual memory)         */
PCB *a2tvpgd(int *err, void *ptree,
		      char *pform, char *pname, int dodnum);
/*a2tvpgd - get model from file                            */
/*                    (with use of virtual memory)         */
PCB *a2tvpg(int *err, void *ptree,
		      char *pform, char *pname);
       /* err= 0 O'K                                       */
       /*     -1 form not found                            */
       /*     -2 errors of writing                         */
       /*     -3 not enough memory                         */
       /*     -4 part description contains errors          */
/*-------- a2tvpe - delete part of model from data tree ---*/
void a2tvpe(int *err,void *ptr, char *pform, char *pname);
       /* err= 0, O'K                                      */
       /* err=-2, errors while data tree processing        */
/*-------- a2tvfe - delete form from data tree ------------*/
void a2tvfe(int *err,void *ptr, char *pform);
       /* err= 0, O'K                                      */
       /* err=-2, errors while data tree processing        */
/*------------------ a2tvpf - buffer clearing -------------*/
a2tvpf(void);
/*-------- a2tvfrr - read form descriptor from data tree --*/
FRCB *a2tvfrr(int *err, void *ptree, char *pform);
/* err= 0 - O'K ;
       -1 - form or part not found;
       -2 - errors while reading;
       -3 - not enough memory;
       -4 - part description contains errors.
*/
/*--------- a2tvfrw - write form descriptor to data tree --*/
a2tvfrw(int *err,void *ptree, FRCB *frcb, char *pform);
/* err= 0 - O'K ;
       -2 - errors while writing;
       -4 - form description contains errors.
*/

#ifndef _A2TVDR_F
#define _A2TVDR_F
/*--- a2tvdr - read document for printing from data tree --*/
#define  DC_PRT  0x02
#define  DC_COR  0x04
DOC *a2tvdr(int *err, void *ptree, char *dname, char *stream);
/* err as input parameter defines sequence of parts and takes
   values:
   DC_COR - by coordinates; DC_PRT - by part attributes    */
/* (headers, periods, totals); else by part names;         */
/* ptree - pointer to models file; dname - document name;  */
/* stream - flow name or NULL (page counters don't reset,  */
/* flow doesn't associate with document during loading)    */
#endif
/*----------- a2opmafl - file of models opening -----------*/
void *a2opmafl(char rgm, int *err, char *fln);
/* if rgm!='n' file must exist, search starts in current   */
/* directory, then continues according to path             */
/*====== Check, read and write string array as a text =====*/
/*------- a2acchtp - check type the current vertex --------*/
a2acchtp(ACCESS *pbase, char *nm_line);
/* nm_line - NULL or field for string vertex name; 0 - if  */
/* current vertex is the string array, -1 in other case    */
/*---------- a2acrdtx - read text from base ---------------*/
LDSC *a2acrdtx(int *err, ACCESS *pbase);
/*  err= 0 o'k, -2 - error from read */
/*------------ a2acwrtx - write text from base ------------*/
a2acwrtx(ACCESS *pbase, LDSC *ldsc);
/*  err= 0 o'k, -2 - error from write */

/*=============== Read and write Pick File ================*/
/*----------- a2get_pick - read pick file -----------------*/
a2get_pick(int n_txt, LDSC **txt, char *pick_file);
/* number of texts; array of points; pick file name        */
/*----------- a2put_pick - write pick file ----------------*/
a2put_pick(int n_txt, LDSC **txt, char *pick_file);
/* number of texts; array of points; pick file name        */
#ifdef __cplusplus
}
#endif
/*---------------------------------------------------------*/
